//
//  HotPointNarrowCell.m
//  XDCommonApp
//
//  Created by XD-XY on 3/6/14.
//  Copyright (c) 2014 XD-XY. All rights reserved.
//

#import "HotPointNarrowCell.h"
#import "XDHeader.h"
#import "XDTools.h"
@implementation HotPointNarrowCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
        [self makeView];
    }
    return self;
}

-(void)makeView
{
    UIView * heardView = [[UIView alloc] initWithFrame:CGRectMake(15, 10, 290, 82/2.0f)];
    heardView.backgroundColor = [UIColor whiteColor];
    
    self.starNumberImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 75/2.0f, heardView.frame.size.height)];
    
    self.numberLabel = [[UILabel alloc] initWithFrame:_starNumberImageView.bounds];
    _numberLabel.backgroundColor = [UIColor clearColor];
    _numberLabel.textColor = [UIColor whiteColor];
    _numberLabel.font = [UIFont boldSystemFontOfSize:20];
    _numberLabel.textAlignment = NSTextAlignmentCenter;
    
    self.starHeardImageView = [[UIImageView alloc] initWithFrame: CGRectMake(width_x(_starNumberImageView),0,heardView.frame.size.height,heardView.frame.size.height)];
    
    self.starNameLabel = [[UILabel alloc] initWithFrame:CGRectMake(width_x(_starHeardImageView)+7, 0, 240/2,25)];
    _starNameLabel.font = [UIFont systemFontOfSize:14];
    _starNameLabel.textColor = TEXTBLACKCOLORE;
    _starNameLabel.backgroundColor = [UIColor clearColor];
    
    self.artWorkCountLabel = [[UILabel alloc] initWithFrame:CGRectMake(_starNameLabel.frame.origin.x,height_y(_starNameLabel)-1, _starNameLabel.frame.size.width, 12.5)];
    _artWorkCountLabel.font = [UIFont systemFontOfSize:12.5];
    _artWorkCountLabel.textColor = TEXTBLACKCOLORE2;
    _artWorkCountLabel.backgroundColor = [UIColor clearColor];

    UIImageView * attentionImageView = [[UIImageView alloc] initWithFrame:CGRectMake(200, 8, 12, 8)];
    attentionImageView.image = [UIImage imageNamed:@"hotPoint_attention"];
    [heardView addSubview:attentionImageView];

    self.starBrowseLabel = [[UILabel alloc] initWithFrame:CGRectMake(width_x(attentionImageView),6, 35,12)];
    _starBrowseLabel.font = [UIFont systemFontOfSize:12];
    _starBrowseLabel.backgroundColor = [UIColor clearColor];
    _starBrowseLabel.textAlignment = NSTextAlignmentCenter;
    _starBrowseLabel.textColor = TEXTBLACKCOLORE4;

    self.starCollectLabel = [[UILabel alloc] initWithFrame:CGRectMake(width_x(attentionImageView), height_y(_starBrowseLabel)+4, 35,12)];
    _starCollectLabel.font = [UIFont systemFontOfSize:12];
    _starCollectLabel.backgroundColor = [UIColor clearColor];
    _starCollectLabel.textAlignment = NSTextAlignmentCenter;
    _starCollectLabel.textColor = TEXTBLACKCOLORE4;
    
    UIImageView * collectImageView = [[UIImageView alloc] initWithFrame:CGRectMake(attentionImageView.frame.origin.x, height_y(attentionImageView)+13/2.0f, 11, 11)];
    collectImageView.image = [UIImage imageNamed:@"hotPoint_collect"];
    [heardView addSubview:collectImageView];

    UIImageView * btnImageView = [[UIImageView alloc] initWithFrame:CGRectMake(heardView.frame.size.width-15-19, 4.5, 19, 19)];
    btnImageView.image = [UIImage imageNamed:@"hotPoint_data"];
    [heardView addSubview:btnImageView];

    UILabel * label = [[UILabel alloc] initWithFrame:CGRectMake(btnImageView.frame.origin.x, height_y(btnImageView)+3.5, 30, 10)];
    label.font = [UIFont systemFontOfSize:9.5];
    label.textColor = TEXTBLACKCOLORE3;
    label.backgroundColor = [UIColor clearColor];
    label.text = @"数据";
    [heardView addSubview:label];

    self.rightBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    _rightBtn.frame = CGRectMake(heardView.frame.size.width-(38/2+30),0,38/2+30,82/2.0f);
    _rightBtn.backgroundColor = [UIColor clearColor];
    
    
    UIImageView *imageView = [[UIImageView alloc] init];
    imageView.frame = CGRectMake(0,0, 290, 461/2.0f);
    imageView.image = [UIImage imageNamed:@"cell_for_Productioncell"];
    self.backgroundView = imageView;
    [self.backgroundView drawRect:CGRectMake(15,10,290,461/2.0f)];
    imageView.backgroundColor = [UIColor clearColor];
    
    UIImageView *selectbg = [[UIImageView alloc] init];
    selectbg.frame = CGRectMake(0,0, 290, 461/2.0f);
    selectbg.image = [UIImage imageNamed:@"cell_for_Productioncellselect"];
    self.selectedBackgroundView = selectbg;
    
    [self addSubview:heardView];
    [heardView addSubview:_starNumberImageView];
    [heardView addSubview:_starHeardImageView];
    [heardView addSubview:_starNameLabel];
    [heardView addSubview:_artWorkCountLabel];
    [heardView addSubview:_starBrowseLabel];
    [heardView addSubview:_starCollectLabel];
    [heardView addSubview:_rightBtn];
    [heardView addSubview:_numberLabel];
    
//    [self.contentView drawRect:CGRectMake(15,10,290,461/2.0f)];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
